package br.com.tiespec.web.ManagedBean;

import java.io.Serializable;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.SessionScoped;
import javax.inject.Named;

import br.com.tiespec.ejb.EjbInterface.ConfirmacaoCadastroInterface;
import br.com.tiespec.model.Util.RNException;
import br.com.tiespec.web.Util.MsgUtil;

@Named("confirmacaoEmailBean")
@SessionScoped
public class ConfirmacaoEmailBean implements Serializable {

	private static final long serialVersionUID = -3363556452967981170L;
	
	@EJB ConfirmacaoCadastroInterface ejb;
	
	@PostConstruct
	public void init(){
		
	}
	
	public void setId(String id) {
		try {
			ejb.confirmarToken(id);
			MsgUtil.msgInfo("TUDO CERTO");
		} catch (RNException e){
			MsgUtil.msgWarn("NADA CERTO");
		}
		
	}
}